-- GENERATED SPELL FOR [Image of Dementia] --


function spell0_23436(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(41399,pUnit)
pUnit:RegisterEvent('Sorts_23436', 15000, 1)
end

function spell1_23436(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(41400,pUnit)
pUnit:RegisterEvent('Sorts_23436', 621, 1)
end

function Sorts_23436(pUnit, Event)
local choix_sorts_23436 = math.random(0, 1)
if choix_sorts_23436 == 0 then
pUnit:RegisterEvent('spell0_23436', 1, 1)
end
if choix_sorts_23436 == 1 then
pUnit:RegisterEvent('spell1_23436', 1, 1)
end
end

function mob23436_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_23436', math.random(1500, 3000), 1)
end

function mob23436_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23436_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23436_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(23436, 1, 'mob23436_Action')
RegisterUnitEvent(23436, 2, 'mob23436_Leave')
RegisterUnitEvent(23436, 3, 'mob23436_Kill')
RegisterUnitEvent(23436, 4, 'mob23436_Die')
